<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="http://localhost:8089/_javaWebProjectJD/js/ueditor1_2_3_0-utf8-jsp_min/editor_config.js"></script>
   <script type="text/javascript" src="http://localhost:8089/_javaWebProjectJD/js/ueditor1_2_3_0-utf8-jsp_min/editor_all.js"></script>
   <link rel="stylesheet" type="text/css" href="http://localhost:8089/_javaWebProjectJD/js/ueditor1_2_3_0-utf8-jsp_min/themes/default/ueditor.css" />
<style type="text/css">
* {
	margin: 0px;
	padding: 0px;
}

#All_addPage {
	width: 100%;
}

tr td {
	height: 33px;
	line-height: 33px;
}

a {
	font-size: 13px;
	text-decoration: none;
}

.label {
	font-family: "宋体";
	font-size: 14px;
	font-weight: bold;
	width: 200px;
	text-align: right;
}

span {
	font-size: 12px;
}
.button-div {
	width: 300px;
	height: 45px;
	line-height: 45px;
	text-align: right;
}

.a_button {
	width: 80px;
	height: 20px;
	color: white;
	text-align: center;
	line-height: 20px;
	font-family: "宋体";
	background-color: #DDEEF2;
	border: solid 1px #91C4D0;
	box-shadow: 0px 1px 1px #91C4D0;
}

table {
	margin: 0 200px;
}

.button {
	width: 82px;
	height: 25px;
	background-color: threeddarkshadow;
	color: white;
	cursor: pointer;
	box-shadow: 1px 1px 1px threeddarkshadow;
}

#tabbar-div {
	width: 100%;
	background-color: threeddarkshadow;
	height: 40px;
}

 #general-tab {
	height: 40px;
	line-height: 40px;
	list-style: none;
	    background-color:#CFCFCF; 
	margin-left: 35px;
	color: white;
	float: left;
	font-family: "宋体";
	font-size: 15px; 
}
 #detail-tab {
	height: 40px;
	line-height: 40px;
	list-style: none;
	margin-left: 35px;
	color: white;
	float: left;
	font-family: "宋体";
	font-size: 15px;
}
 #mix-tab {
	height: 40px;
	line-height: 40px;
	list-style: none;
	margin-left: 35px;
	color: white;
	float: left;
	font-family: "宋体";
	font-size: 15px;
}
 #properties-tab{
	height: 40px;
	line-height: 40px;
	list-style: none;
	margin-left: 35px;
	color: white;
	float: left;
	font-family: "宋体";
	font-size: 15px;
}
 #gallery-tab{
	height: 40px;
	line-height: 40px;
	list-style: none;
	margin-left: 35px;
	color: white;

	float: left;
	font-family: "宋体";
	font-size: 15px;
}
 #linkgoods-tab{
	height: 40px;
	line-height: 40px;
	list-style: none;
	margin-left: 35px;
	color: white;
	float: left;
	font-family: "宋体";
	font-size: 15px;
}
 #tab-back {
	height: 40px;
	line-height: 40px;
	list-style: none;
	margin-left: 35px;
	color: white;
	float: left;
	font-family: "宋体";
	font-size: 15px;
}
 #groupgoods-tab {
	height: 40px;
	line-height: 40px;
	list-style: none;
	margin-left: 35px;
	color: white;
	float: left;
	font-family: "宋体";
	font-size: 15px;
}
 #article-tab {
	height: 40px;
	line-height: 40px;
	list-style: none;
	margin-left: 35px;
	color: white;
	float: left;
	font-family: "宋体";
	font-size: 15px;
}
ul li{
 cursor: pointer;
}
.add{

    background-color:#CFCFCF; 

}
</style>
</head>
<body>
	<div id="All_addPage">
		<div>
			<div id="tabbar-div">
				<ul>
					<li class="tab-back" id="general-tab" >通用信息</li>
					<li class="tab-back" id="detail-tab">详细描述</li>
					<li class="tab-back" id="mix-tab" >其他信息</li>
					<li class="tab-back" id="properties-tab" >商品属性</li>
					<li class="tab-back" id="gallery-tab" >商品相册</li>
					<li class="tab-back" id="linkgoods-tab" >关联商品</li>
					<li class="tab-back" id="groupgoods-tab" >配件</li>
					<li class="tab-back" id="article-tab" >关联文章</li>
				</ul>
			</div>
		</div>
		<div id="One_from" style="display: none;">
			<form enctype="multipart/form-data" action="" method="post">
				<table  id="general-table" align="center"
					class="goods_info">
					<tr>
						<td class="label">商品名称：<span>&nbsp&nbsp</span></td>
						<td><input type="text" name="goods_name" id="goodsname" value=""
							style="float: left; color:;" size="30" /></td>
					</tr>
					<tr>
						<td class="label"><a href="" title="点击此处查看提示信息"> <img
								src="../img/what.png" width="16" height="16" border="0"
								alt="点击此处查看提示信息">
						</a> 商品货号：<span>&nbsp&nbsp</span></td>
						<td><input type="text" name="goods_sn" value="" size="20"
							id="goodssn" /> <span
							id="goods_sn_notice"></span> <span class="notice-span"
							style="display: block" id="noticeGoodsSN">如果您不输入商品货号，系统将自动生成一个唯一的货号。</span>
						</td>
					</tr>
					<tr>
						<td class="label">商品分类：<span>&nbsp&nbsp</span></td>
						<td style="float: left;"><input type="text" id="catid">
						<!-- 	<div style="float: right; margin-left: 10px;" class="a_button">
								<a href="" onclick="" title="添加分类" class="special">添加分类</a>
							</div> <span id="category_add" style="display: none;"> <input
								class="text" size="10" name="addedCategoryName" /> <a href=""
								onclick="" title=" 确定 " class="special"> 确定 </a> <a href=""
								onclick="" title="分类管理" class="special">分类管理</a> <a href=""
								onclick="" title="隐藏" class="special"> </a>
						</span> --></td>
					</tr>
					<tr>
						<td class="label">扩展分类：<span>&nbsp&nbsp</span></td>
						<td><input type="button" value="添加" onclick="" class="button" />
						</td>
					</tr>
					<tr>
						<td class="label">商品品牌：<span>&nbsp&nbsp</span></td>
						<td><input type="text" id="brandid"><!-- <div class="a_button">
								<a href="" title="添加品牌" onclick="" class="special">添加品牌</a>
							</div> <span id="brand_add" style="display: none;"> <input
								class="text" size="15" name="addedBrandName" /> <a href=""
								onclick="" class="special"> 确定 </a> <a href="" onclick=""
								title="品牌管理" class="special">品牌管理</a> <a href="" onclick=""
								title="隐藏" class="special"> </a>
						</span> --></td>
					</tr>
					<tr>
						<td class="label">本店售价：<span>&nbsp&nbsp</span></td>
						<td><input type="text" name="shop_price" value="0" size="20"
							id="marketprice" /> <input type="button" value="按市场价计算" onclick="" /></td>
					</tr>
					<tr>
						<td class="label"><a href="" title="点击此处查看提示信息"> <img
								src="../img/what.png" width="16" height="16" border="0"
								alt="点击此处查看提示信息">
						</a>赠送消费积分数：<span>&nbsp&nbsp</span></td>
						<td><input type="text" name="give_integral" value="-1"
							size="20" id="integral"/> <span class="notice-span" style="display: block"
							id="integral">购买该商品时赠送消费积分数,-1表示按商品价格赠送</span></td>
					</tr>
					<tr>
						<td class="label"><a href="#" title="点击此处查看提示信息"> <img
								src="../img/what.png" width="16" height="16" border="0"
								alt="点击此处查看提示信息">
						</a>赠送等级积分数：<span>&nbsp&nbsp</span></td>
						<td><input type="text" name="rank_integral" value="-1"
							size="20" id="giveintegral"/> <span class="notice-span" style="display: block"
							>购买该商品时赠送等级积分数,-1表示按商品价格赠送</span></td>
					</tr>
				
					<tr>
						<td class="label">上传商品图片：<span>&nbsp&nbsp</span></td>
						<td><input type="file" name="goods_img" size="35" id="goodsimg" /> <img
							src="" /> <input type="text" size="40" value="商品图片外部URL"
							style="color: #aaa;"
							onfocus="if (this.value == '商品图片外部URL'){this.value='http://';this.style.color='#000';}"
							name="goods_img_url" /></td>
					</tr>
					
				</table>
				<div class="button-div" style="margin: 0 396px;">
					<input type="hidden" name="goods_id" value="0" /> <input
						type="button" value=" 确定 " class="button" onclick=""
						style="margin-right: 50px" id="submit_add"/> <input type="reset" value=" 重置 "
						class="button" />

				</div>
				<input type="hidden" name="act" value="insert" />
			</form>
		</div>
		<div style="display: none;width: 100%;" id="comment_two">
		<br />
		<p style="font-weight: bold;font-size: 20px;font-family: '宋体';">管理中心 - 添加新商品</p>
		 <!-- <form action="/" method="post"> -->
		<br/>
		<div  style="width: 1131px;height:460px;border: solid 1px red;">
		<textarea id="content" name="content"  style="background-color: gray;width:800px;height:300px; margin: 0px auto;" >
		</textarea>
		</div>
		<br>
		<div style="width: 800px;height 30px;border: solid 1px red;margin: 0 auto;text-align: right;">
		<input type="button"  id="button"  value="提交" style="width: 80px;height: 24px;font-size: 14px;font-family: '宋体';cursor: pointer;" >
		 <input type="reset" id="reset" value="重置" style="width: 80px;height: 24px;font-size: 14px;font-family: '宋体'; cursor: pointer;"></div>
		<!-- </form> -->
		</div>
	</div>
	<script type="text/javascript" src="../js/jquery-3.1.0.js"></script>
	<script type="text/javascript">
     $(function(){
	    $("#edui1_iframeholder").css("height","180px");
		$("input[type='text']").css("height", "25px");
		$("ul li").eq(0).css("background-color", "#CFCFCF");
		$("ul li").eq(0).css("font-weight", "bold");
		 var abc = new baidu.editor.ui.Editor();
		    abc.render('content');
		
		 $("#submit_add").click(function(){
			var goodsid=$("#goodsid").val();
			var catid=$("#catid").val();
			var goodssn=$("#goodssn").val();
			var goodsname=$("#goodsname").val();
			var brandid=$("#brandid").val();
			var marketprice=$("#marketprice").val();
			var goodsimg=$("#goodsimg").val();
			var integral=$("#integral").val();
			var giveintegral=$("#giveintegral").val();
				alert("id"+goodsid+catid+goodssn+goodsname+brandid+marketprice+goodsimg+integral+giveintegral);
			    $.ajaxSettings.async = false;
				$.getJSON("../GoodsServlet?method=addNewGoods",
		    		{
		    	catid:catid,
		    	goodssn:goodssn,
		    	goodsname:goodsname,
		    	brandid:brandid,
		    	marketprice:marketprice,
		    	goodsimg:goodsimg,
		    	integral:integral,
		    	giveintegral:giveintegral
		    		},
		    		function(date){
		    	if (date=="0") {
					alert("数据插入成功");
					$("#rightdiv").load("../yf/goodslist.jsp")
				}
		    })
		})
		$(function(){
			
			$("#One_from").css("display","block");
			 $("#nb").click(function(){
        		 abc.val();
			 })
			$("ul").on("click","li",function(){
				    $("ul li").removeClass("add");
				    $(this).addClass("add"); 
				    var x=$(this).attr("id");
						switch (x) {
						case "general-tab":
							$("#general-tab").css("background-color","#cfcfcf");
							$("#One_from").css("display","block");
							$("#comment_two").css("display","none");
							break;
						case "detail-tab":
							$("#general-tab").css("background-color","threeddarkshadow");
							$("#One_from").css("display","none");
							$("#comment_two").css("display","block");
							break;
						case "mix-tab":
							alert("yf第三帅");
							break;
						case "properties-tab":
							alert("yf第四帅");
							break;
						case "gallery-tab":
							alert("yf第五帅");
							break;
						case "linkgoods-tab":
							alert("yf第六帅");
							break;
						case "groupgoods-tab":
							alert("yf第七帅");
							break;
						case "article-tab":
							alert("yf第八帅");
							break;

						default:
							break;
						}
			
			})
			
		})
		$("#button").click(function(){
			alert($("#content").val());
		    var content = CKEDITOR.instances.contect_text.getData();
		    alert(content);
		})
		
     })
	</script>


</body>
</html>